{% extends "base.html" %}

{% block title %}用户详情{% endblock %}

{% block content %}
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header d-flex justify-content-between align-items-center">
                    <h4 class="mb-0">用户详情</h4>
                    <a href="{{ url_for('main.edit_user', user_id=user.id) }}" class="btn btn-primary btn-sm">
                        <i class="fas fa-edit"></i> 编辑
                    </a>
                </div>
                <div class="card-body">
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">用户名</div>
                        <div class="col-md-8">{{ user.username }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">电子邮箱</div>
                        <div class="col-md-8">{{ user.email }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">姓名</div>
                        <div class="col-md-8">{{ user.full_name }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">联系电话</div>
                        <div class="col-md-8">{{ user.phone }}</div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">用户角色</div>
                        <div class="col-md-8">
                            {% if user.role == 'engineer' %}
                            测控工程师
                            {% elif user.role == 'manager' %}
                            项目管理人员
                            {% else %}
                            系统集成商
                            {% endif %}
                        </div>
                    </div>
                    <div class="row mb-3">
                        <div class="col-md-4 text-muted">所属部门</div>
                        <div class="col-md-8">{{ user.department }}</div>
                    </div>
                </div>
                <div class="card-footer">
                    <a href="{{ url_for('main.users') }}" class="btn btn-secondary">
                        <i class="fas fa-arrow-left"></i> 返回用户列表
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 